<div class="buttons">
<?php
	if ($setting['Facebook_oauth_status']) { //facebook
		if ($setting['window_mode'] == 'dialog') {
?>
<a href="javascript:void(0)" onclick="openDialog('Facebook')" class="button"><?php echo $_['login_with_facebook']?></a>
<?php  } else { ?>
	<a class="button" href="<?php echo US('account/oauth', 's=Facebook')?>" target="_blank"><?php echo $_['login_with_facebook']?></a>
<?php  } ?>
<?php } ?>

<?php
	if ($setting['Google_oauth_status']) { //google
		if ($setting['window_mode'] == 'dialog') {
?>
	<a class="button" href="javascript:void(0)" onclick="openDialog('Google')"><?php echo $_['login_with_google']?></a>
</div>
<?php  } else { ?>
	<a class="button" href="<?php echo US('account/oauth', 's=Google')?>" target="_blank"><?php echo $_['login_with_google']?></a>
<?php  } ?>

<?php } ?>
</div>
<script><!--
function oauth_login() {
	$redirect = $('input[name="redirect"]').val();
	if ($redirect) {
		window.location.href = $redirect;
	}
	else {
		window.location.href = '<?php echo US('account/account');?>';
	}
}

function openDialog(s) {
	window.open('<?php echo US('account/oauth');?>&s=' + s, "Login", "width=550,height=420,menubar=0,scrollbars=0, resizable=1,status=1,titlebar=0,toolbar=0,location=1");
}
//--></script>